package com.lxq.test2012.main01;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int count=0; //指标数
        int[] weight,score;
        int point=0;//安全指数

        Scanner sc = new Scanner(System.in);

        //输入指标数
        while(count<2||count>100000) {
            count = sc.nextInt();
        }

        weight = new int[count];
        score = new int[count];

        //赋值
        for (int i = 0; i < count; i++) {
            if(sc.hasNextInt()) {
                weight[i] = sc.nextInt();
                score[i] = sc.nextInt();
            }

        }

        //运算
        for (int j = 0; j < count; j++) {
            point += weight[j]*score[j];
            System.out.println(point);
        }
        if(point < 0) point = 0;

        //输出
        System.out.println("jieguo: "+point);


    }
}
